package org.linlinjava.litemall.wx.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.linlinjava.litemall.core.util.JsonResponse;
import org.linlinjava.litemall.db.domain.LitemallCustomer;
import org.linlinjava.litemall.db.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 客服服务
 */
@RestController
@RequestMapping("/wx/customer")
@Validated
@Api("客服服务")
public class WxCustomerController {
    private final Log logger = LogFactory.getLog(WxCustomerController.class);

    @Autowired
    private CustomerService customerService;

    /**
     * 获取客服数据
     *
     * @return 客服数据
     */
    @GetMapping("info")
    @ApiOperation("获取客服数据")
    public JsonResponse list() {
        List<LitemallCustomer> customers = customerService.customerInfo();
        return JsonResponse.ok(customers);
    }

}